package com.hassean.we.admin.controller;

import com.hassean.we.admin.service.HttpClientService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.configurationprocessor.json.JSONException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by yajun on 2019/4/9.
 */
@Api(description = "httpClient接口")
@RestController
@RequestMapping("/httpClient")
public class HttpClientImplController {
    private static Logger logger = Logger.getLogger(HttpClientImplController.class);
    @Autowired
    private HttpClientService httpClientService;
    @ApiOperation(value = "测试httpClient" ,  notes="测试httpClient")
    @RequestMapping("/getData")
    public Object getHttpClintMath()throws JSONException {
        httpClientService.getData();
        return  httpClientService.getData();
    }
    @ApiOperation(value = "权限认证" ,  notes="未使用")
    @RequestMapping("/passAuth")
    public boolean passAuth(@RequestParam String token){

        boolean flag = httpClientService.passAuth(token);
        return  flag;
    }
}
